import App from './App.vue'
import { createApp } from 'vue'
import router, { setupRouter } from '@/router'
import { setupStore } from '@/store'
import { setupGlobDirectives } from '@/setup/directives'
import { setupGlobalMethods } from '@/setup/methods'
import { setupGlobalComponents } from '@/setup/components'
// 引入默认样式
import '@/assets/styles/base.less'

async function bootstrap() {
  const app = createApp(App)

  // Configure store
  setupStore(app)

  // Configure routing
  setupRouter(app)

  // Register global directive
  setupGlobDirectives(app)

  // global properties
  setupGlobalMethods(app)

  // global components
  setupGlobalComponents(app)

  // https://next.router.vuejs.org/api/#isready
  await router.isReady()

  app.mount('#app')
}

bootstrap()
